<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表达式的几种方式</title>
    <link rel="stylesheet" href="../../public/base.css">
    <script src="../../public/angular.min.js"></script>
</head>
<body ng-app="myApp">
    <div ng-controller="myContr">

        <p>
            <mark>第一个在{{}}中的表达式</mark>
            {{5*25}}
        </p>
        <p ng-init="a=15;b=29">
            <mark>使用ng-init指令模拟数据变量：</mark>
            {{a/b | number:2}}
            <mark>早ng-bind中也是可以进行表达式计算的</mark><span ng-bind="a*b"></span>
        </p>
        <p ng-init="t1='websong';age='21岁';obj={o1:'宋宇',o2:'8500'}">
            <mark>字符串和对象也是可以的</mark>
            <span ng-bind="'我叫'+t1+'今年'+age"></span>
            {{obj.o1+'目前收入'+obj.o2}}
        </p>
    </div>
</body>
<script>
    var app=angular.module("myApp",[]);
    app.controller("myContr",function ($scope) {

    })
</script>
</html>